////选中图片时显示
(function(){
	document.getElementById("file2").style.display = "none";
	document.getElementById("file3").style.display = "none";
})()
//上传中
function uploadbg(){
	var spanli = document.getElementById("runline").getElementsByTagName("span");
	var ispan = 0;
	var uptimer;
	uptimer = setInterval(function(){
		for(var i=0;i<4;i++){
			spanli[i].style.height = "4px";
		}
		spanli[ispan].style.height = "8px";
		ispan+=1;
		spanli[ispan].style.height = "12px";
		if(ispan >= 3){
			ispan = 0;
			uploadbg();
			clearInterval(uptimer);
		}
	},150)
}
function showuplod(){
	var upbox = document.getElementById("uploadbg");
	upbox.style.display = "block";
	uploadbg();
}
function hideuplod(){
	var upbox = document.getElementById("uploadbg");
	upbox.style.display = "none";
}
showuplod()//显示
hideuplod();//隐藏

//选择图片
var input2 = input3 = false;
function showImg1(that){
	if(!input2){ //第二张
		input2 = true;
		document.getElementById("file2").style.display = "block";
		var imgFile = that.files[0];
	    var fr = new FileReader();
	    fr.onload = function() {
	    	document.getElementById("ImgPr2").src= fr.result;
	    };
	    fr.readAsDataURL(imgFile);
	}else if(!input3){
		input3 = true;
		document.getElementById("file3").style.display = "block";
		var imgFile = that.files[0];
	    var fr = new FileReader();
	    fr.onload = function() {
	    	document.getElementById("ImgPr3").src= fr.result;
	    };
	    fr.readAsDataURL(imgFile);
	}else{ //第一张
		var imgFile = that.files[0];
	    var fr = new FileReader();
	    fr.onload = function() {
	    	document.getElementById("ImgPr").src= fr.result;
	    };
	    fr.readAsDataURL(imgFile);
	}
}
function showImg2(that){//第二个00
	var imgFile2 = that.files[0];
    var fr2 = new FileReader();
    fr2.onload = function() {
    	document.getElementById("ImgPr2").src= fr2.result;
    };
    fr2.readAsDataURL(imgFile2);
}
function showImg3(that){
	var imgFile3 = that.files[0];
    var fr3 = new FileReader();
    fr3.onload = function() {
    	document.getElementById("ImgPr3").src= fr3.result;
    };
    fr3.readAsDataURL(imgFile3);
}



//标题背景移动
~(function(){
	var timer,len,len1,len2 = null;
	len = 100;
	timer = setInterval(function(){
		len -=1;
		len1 = (len)+"%";
		len2 = (100-len)*-1+"%";
		if(len<=0){
			len = 100;
		}else{
			document.getElementById("titlebg").style.left = len1;
			document.getElementById("titlebg2").style.left = len2;
		}
		
	},100)
	
})()
